﻿using ChatBackend.DBContext.TestRepository;
using ChatBackend.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChatBackend.Services.TestService
{
    public class TestService : ITestService
    {
        private readonly ITestRepository _testRepo;

        public TestService(ITestRepository testRepository)
        {
            _testRepo = testRepository;
        }

        public string return123()
        {
            return "123";
        }

        public async Task<int> AddTest(TestEntity para)
        {
            para.Id = SnowFlakeSingle.Instance.NextId().ToString();
            return await _testRepo.AddTestAsync(para);
        }

        public async Task<List<TestEntity>> QueryTestList()
        {
            return await _testRepo.QueryTestListAsync();
        }

        public async Task<int> DeleteTest(string Id)
        {
            return await _testRepo.DeleteTestAsync(Id);
        }

        public async Task<int> ModifyTest(TestEntity para)
        {
            return await _testRepo.ModifyTestAsync(para);
        }
    }
}